<include file="public@header"/>
<meta charset="UTF-8"/>
<style>
    td{text-align: center}
</style>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Member/index')}">用户管理</a></li>
    </ul>

    <form class="well form-inline margin-top-20" method="post" action="{:url('job/job/index')}">
        关键字：
        <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
               placeholder="要搜索的兼职名或发布者">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('job/index')}">清空</a>
    </form>


    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th align="left" abbr="user_id" axis="col3" class="">
                    <div style="text-align: center; width: 100%;" class="">ID</div>
                </th>
                <th align="left" abbr="user_nickname" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">发布者</div>
                </th>
                <th align="left" abbr="title" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">兼职标题</div>
                </th>
                <th align="left" abbr="address" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">地址</div>
                </th>
                <th align="left" abbr="type" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">结算方式</div>
                </th>
                <th align="left" abbr="money" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">金额</div>
                </th>
                <th align="left" abbr="phone" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">联系电话</div>
                </th>
                <th align="center" abbr="time" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">创建时间</div>
                </th>

                <!--
               <th align="left" abbr="status" axis="col4" class="">
                   <div style="text-align: center; width:  100%;" class="">审核状态</div>
               </th>
               -->

                <th align="center" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">操作</div>
                </th>

            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo" key="k" >

                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.user_nickname}</td>
                    <td>{$vo.title}</td>
                    <td>{$vo.address}</td>

                    <td>
                        <switch name="$vo.type">
                            <case value="1">
                                <span class="label label-warning">天</span>
                            </case>
                            <case value="2">
                                <span class="label label-danger">次</span>
                            </case>
                            <case value="3">
                                <span class="label label-success">件</span>
                            </case>
                        </switch>
                    </td>
                    <td>{$vo.money}</td>
                    <td>{$vo.phone}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>


                    <!--
                    <td>
                        <switch name="$vo.status">
                            <case value="0">
                                <span class="label label-warning">未审核</span>
                            </case>
                            <case value="1">
                                <span class="label label-success">审核通过</span>
                            </case>
                            <case value="2">
                                <span class="label label-danger">不通过</span>
                            </case>
                        </switch>
                    </td>
                    -->


                    <td>
                        <a class="btn btn-xs btn-success"
                           href="{:url('job/detail', ['id' => $vo.id])}">详情</a>
<!--                        <a class="js-ajax-delete" href="{:url('job/delete',['id'=>$vo.id])}">删除</a>-->
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="{:url('job/delete',['id'=>$vo['id']])}">删除</a>
                        </a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js">
</script>
<script>
    function delete_job(id) {
        $.ajax({
            type:"POST",
            //提交的网址
            url:"{:url('job/delete')}",
            data:{id:id},
            datatype: "json",
            success:function(data){
                if(data.status == 1){
                    // layer.msg(data.msg);
                    location.href = location.href;
                }else{
                    // layer.alert(data.msg);
                    location.href = location.href;
                }
            }   ,
            //调用出错执行的函数
            error: function(){
            }
        });


    }
</script>
</body>
</html>